package com.alameda.base.constant;

/**
 * redis键常量类
 *
 * @author Lv
 * @date 2024/2/19
 */
public class ProjectConstant {
    /**
     * 验证码存储key
     */
    public static final String CAPTCHA_CODE = "captcha_code";

    /**
     * 链路id
     */
    public static final String TRACE_ID = "TRACE_ID";

    /**
     * 监听策略常量
     */
    public interface StrategyConstant {
        /**
         * 监听策略
         */
        String LISTEN_STRATEGY = "strategy";

        /**
         * 操作日志策略
         */
        String OPERATE_STRATEGY = "operate";

        /**
         * 登录续期策略
         */
        String RENEWAL_STRATEGY = "renewal";

        /**
         * 删除操作日志策略
         */
        String REMOVE_OPERATE_STRATEGY = "remove";
    }

    /**
     * 操作日志信息属性
     */
    public interface OperateInfoPropertyConstant {
        /**
         * 操作结果 成功
         */
        String OPERATE_RESULT_SUCCESS = "success";

        /**
         * 操作结果 失败
         */
        String OPERATE_RESULT_ERROR = "error";

        /**
         * 操作结果
         */
        String OPERATE_RESULT = "operateResult";

        /**
         * 操作接口名称
         */
        String API_NAME = "apiName";

        /**
         * 操作链路id
         */
        String TRACE_ID = "traceId";

        /**
         * 请求参数
         */
        String REQUEST_PARAM = "requestParam";

        /**
         * 不做记录处理接口
         */
        String UN_SAVE_API = "/user_operate_log/list_user_operate_info";

        /**
         * 管理端登录接口路径
         */
        String ADMIN_LOGIN_API_PATH = "/airborne/login";

        /**
         * 空字符串
         */
        String EMPTY_STRING = "";

        /**
         * 执行sql
         */
        String SQL = "SQL";

        /**
         * 物理删除超过七天的操作日志数据
         */
        String DELETE_SQL = " delete FROM user_operate_log WHERE id IN(SELECT b.id FROM (SELECT a.id FROM user_operate_log a WHERE a.create_time < (now() - INTERVAL 7 day)) b) ";
    }
}
